package com.lxg;

import com.lxg.dao.OrderDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 陆小根
 * date: 2022/04/23
 * Description:
 */

public class AppForInstanceOrder {

  public static void main(String[] args) {
    // 使用静态工厂创建对象
//    OrderDao orderDao = OrderDaoFactory.getOrderDao();
//    orderDao.save();

    //

    ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
    OrderDao orderDao = (OrderDao) context.getBean("orderDao");
    orderDao.save();
  }

}
